<?php
/*
 * 公共类
 * date : 2011-1-21 ; copyright : 7OUR.COM <http://7our.com> ; author : xjay <xucj21@21cn.com>
*/
class PubAction extends Action{
	public function login(){
		$user = Api('User');
		if($user->isLogin())
			redirect(C('WEB_URL'),3,'您已经登录');		
		if($this->isPost()){			
			if($user->doLogin($_POST)){
				redirect(C('WEB_URL'));
			}else{
				echo $user->getError();
			}
		}else{
			$this->display();
		}
	}
	public function reg(){
		$this->display();
	}
	public function logout(){
		Session::destroy();
	}
}